﻿using System;
using System.Collections.Generic;
using System.Text;

namespace WindowsUserControl.Codes
{
    /// <summary>
    /// Contains the lexical state IDs for the <c>Simple</c> language.
    /// </summary>
    public class SimpleLexicalStateID
    {

        /// <summary>
        /// Returns the string-based key for the specified lexical state ID.
        /// </summary>
        /// <param name="id">The lexical state ID to examine.</param>
        public static string GetLexicalStateKey(int id)
        {
            System.Reflection.FieldInfo[] fields = typeof(SimpleLexicalStateID).GetFields();
            foreach (System.Reflection.FieldInfo field in fields)
            {
                if ((field.IsStatic) && (field.IsLiteral) && (id.Equals(field.GetValue(null))))
                    return field.Name;
            }
            return null;
        }

        /// <summary>
        /// The Default lexical state ID.
        /// </summary>
        public const int Default = 0;

    }
}
